package com.yuanlrc.base.dao.admin;


import com.yuanlrc.base.entity.admin.Student;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface StudentDao extends JpaRepository<Student, Long> {



    /**
     * 按照学生名查找学生信息
     * @param studentName
     * @return
     */
    public Student findByStudentName(String studentName);

    /**
     * 按照学号查找学生信息
     * @param studentId
     * @return
     */
    public Student findByStudentId(String studentId);

    /**
     * 根据学生id查询
     * @param id
     * @return
     */
    @Query("select u from Student u where id = :id")
    public Student find(@Param("id") Long id);
    
}
